﻿@using Seal.Model;
@{
    ReportViewTemplate Template = Model;

    //Template Name
    Template.Name = ReportViewTemplate.DataTableName;
    Template.Description = "Render the Data Table of the page result.";

    //If true, the view can be configured for a report modelbtotals

    Template.ForReportModel = false;
    Template.IsModelViewChild = true;

    //Parameters for this template
            Template.Parameters.Add(new Parameter() { Name = "data_table_caption", DisplayName = "Caption", Description = "Optional caption or title displayed at the bottom of the data table." });
    Template.Parameters.Add(new Parameter() { Name = "data_table_caption_css", DisplayName = "Caption CSS Style", Value = "text-align:center;", Description = "CSS style attribute of the table caption.", Enums = new string[] { "caption-side:bottom; text-align:center;", "caption-side:top; text-align:right; font-weight:bold;" }, UseOnlyEnumValues = false });
    Template.Parameters.Add(new Parameter() { Name = "data_tables_enabled", DisplayName = "Data tables: Is enabled", BoolValue = true, Description = "If true, Data Tables feature is enabled to allow pagination, sorting and filtering in tables." });
    Template.Parameters.Add(new Parameter() { Name = "data_tables_scrolly", Value = "", DisplayName = "Data tables: Vertical scrolling", Description = "If set, it constrains the table to the given height, and enable scrolling for any data which overflows the current viewport.", Enums = new string[] { "200px", "300px" }, UseOnlyEnumValues = false });
    Template.Parameters.Add(new Parameter() { Name = "data_tables_scrollx", DisplayName = "Data tables: Horizontal scrolling", BoolValue = false, Description = "If true, horizontal scrolling in the table is enabled. The responsive layout must be disabled." });
    Template.Parameters.Add(new Parameter() { Name = "data_tables_scrollcollapse", DisplayName = "Data tables: Scroll collapse", BoolValue = false, Description = "If true, allows the table to reduce in height when a limited number of rows are shown." });
    Template.Parameters.Add(new Parameter() { Name = "data_tables_responsive", DisplayName = "Data tables: Is responsive", BoolValue = true, Description = "If true, the table layout is optimised for different screen sizes. Hidden columns can be viewed by clicking on the row. The horizontal scrolling must be disabled." });
    Template.Parameters.Add(new Parameter() { Name = "data_tables_sort_enabled", DisplayName = "Data tables: Sort is enabled", BoolValue = true, Description = "If true, the sort feature of the data table is enabled." });
    Template.Parameters.Add(new Parameter() { Name = "data_tables_sort_configuration", DisplayName = "Data tables: Sort configuration", Description = "If not empty, defines how the columns of the table are sorted (e.g. set \"[1,'desc']' to sort the second column descending). The keyword '{LAST}' can be used to be replaced by the last column index of the table. This may be used to sort the table by 'Total' columns.", Enums = new string[] { "[0,'asc']", "[{LAST},'asc']", "[{LAST}-1,'desc']", "[1,'desc']","[0,'desc'],[2,'asc']", "[0,'desc']", "[2,'desc'],[1,'asc']" }, UseOnlyEnumValues = false });
    Template.Parameters.Add(new Parameter() { Name = "data_tables_filter_enabled", DisplayName = "Data tables: Filter is enabled", BoolValue = true, Description = "If true, the filter feature of the data table is enabled." });
    Template.Parameters.Add(new Parameter() { Name = "data_tables_pagination_enabled", DisplayName = "Data tables: Pagination is enabled", BoolValue = true, Description = "If true, the pagination feature of the data table is enabled." });
    Template.Parameters.Add(new Parameter() { Name = "data_tables_pagination_size", DisplayName = "Data tables: Pagination size", Value = "25", Enums = new string[] { "5", "10", "25", "50", "100", "500", "-1|All" }, Description = "Number of rows displayed in a page (if pagination is enabled)." });
    Template.Parameters.Add(new Parameter() { Name = "data_tables_show_information", DisplayName = "Data tables: Show information", BoolValue = true, Description = "If true, the number of records is displayed in the data table." });
    Template.Parameters.Add(new Parameter() { Name = "data_tables_show_processing", DisplayName = "Data tables: Show processing", BoolValue = true, Description = "If true, a processing message is displayed when working." });
    Template.Parameters.Add(new Parameter() { Name = "data_tables_dom", DisplayName = "Data tables: DOM", Value = "<'row'<'col-sm-6'l><'col-sm-6'f>><'row'<'col-sm-12'tr>><'row'<'col-sm-5'i><'col-sm-7'p>>", Description = "Define the table control elements to appear on the page and in what order as explained at https://datatables.net/reference/option/dom." });
    Template.Parameters.Add(new Parameter() { Name = "data_tables_show_navigation", DisplayName = "Data tables: Show header navigation icon", BoolValue = true, Description = "If true, a navigation icon added to the header of columns having cells with navigation links." });
    Template.Parameters.Add(new Parameter() { Name = "data_tables_fixheader", DisplayName = "Data tables (Extension): Fixed header", BoolValue = false, Description = "If true, the table header is fixed. Not compatible with fixed columns and scroller." });
    Template.Parameters.Add(new Parameter() { Name = "data_tables_fixfooter", DisplayName = "Data tables (Extension): Fixed footer", BoolValue = false, Description = "If true, the table footer is fixed. Not compatible with fixed columns and scroller." });
    Template.Parameters.Add(new Parameter() { Name = "data_tables_fixcolleft", DisplayName = "Data tables (Extension): Fixed left columns", NumericValue = 0, Description = "Freeze one or more columns to the left of a horizontally scrolling table. Horizontal scrolling must be enabled. Not compatible with fixed headers.", Enums = new string[] { "0", "1", "2", "3" }, UseOnlyEnumValues = false });
    Template.Parameters.Add(new Parameter() { Name = "data_tables_fixcolright", DisplayName = "Data tables (Extension): Fixed right columns", NumericValue = 0, Description = "Freeze one or more columns to the right of a horizontally scrolling table. Horizontal scrolling must be enabled. Not compatible with fixed headers.", Enums = new string[] { "0", "1", "2", "3" }, UseOnlyEnumValues = false });
    Template.Parameters.Add(new Parameter() { Name = "data_tables_spane", DisplayName = "Data tables (Extension): Scroller", BoolValue = false, Description = "If true, the table draws only the small visible section of the table (plus a small overlap for smooth scrolling). Pagination must be enabled and a Vertical Scrolling value must be set. Not compatible with fixed headers." });
    Template.Parameters.Add(new Parameter() { Name = "data_tables_scroller", DisplayName = "Data tables (Extension): Scroller", BoolValue = false, Description = "If true, the table draws only the small visible section of the table (plus a small overlap for smooth scrolling). Pagination must be enabled and a Vertical Scrolling value must be set. Not compatible with fixed headers." });
    Template.Parameters.Add(new Parameter() { Name = "data_table_class", Value = "table-responsive table table-striped table-hover table-condensed table-report", DisplayName = "Table CSS Class", Description = "CSS class attribute of the table.", Enums = new string[] { "table table-striped table-hover table-bordered table-responsive table-condensed" }, UseOnlyEnumValues = false });
    Template.Parameters.Add(new Parameter() { Name = "data_table_css", Value = "", DisplayName = "Table CSS Style", Description = "CSS style attribute of the table.", Enums = new string[] { "margin:10px;", "padding:10px;", "font-size:10px;" }, UseOnlyEnumValues = false });
    Template.Parameters.Add(new Parameter() { Name = "data_table_header_class", Value = "active", DisplayName = "Header row CSS class", Description = "CSS class attribute of the header rows.", Enums = new string[] { "active", "success", "info", "warning", "danger" }, UseOnlyEnumValues = false });
    Template.Parameters.Add(new Parameter() { Name = "data_table_header_css", Value = "", DisplayName = "Header row CSS Style", Description = "CSS style attribute of the header rows.", Enums = new string[] { "color:red;font-size:15pt;" }, UseOnlyEnumValues = false });
    Template.Parameters.Add(new Parameter() { Name = "data_table_body_class", Value = "", DisplayName = "Body row CSS class", Description = "CSS class attribute of the body rows.", Enums = new string[] { "success", "info", "warning", "danger" }, UseOnlyEnumValues = false });
    Template.Parameters.Add(new Parameter() { Name = "data_table_body_css", Value = "", DisplayName = "Body row CSS Style", Description = "CSS style attribute of the body rows.", Enums = new string[] { "color:red;font-size:15pt;" }, UseOnlyEnumValues = false });
    Template.Parameters.Add(new Parameter() { Name = "data_table_subtotal_class", Value = "tr-sub-totals", DisplayName = "Sub-totals row CSS class", Description = "CSS class attribute of the sub-totals rows.", Enums = new string[] { "success", "info", "warning", "danger" }, UseOnlyEnumValues = false });
    Template.Parameters.Add(new Parameter() { Name = "data_table_subtotal_css", Value = "", DisplayName = "Sub-totals row CSS Style", Description = "CSS style attribute of the sub-totals rows.", Enums = new string[] { "color:red;font-size:15pt;" }, UseOnlyEnumValues = false });
    Template.Parameters.Add(new Parameter() { Name = "data_table_footer_class", Value = "active tr-totals", DisplayName = "Footer row CSS class", Description = "CSS class attribute of the footer rows.", Enums = new string[] { "success", "info", "warning", "danger" }, UseOnlyEnumValues = false });
    Template.Parameters.Add(new Parameter() { Name = "data_table_footer_css", Value = "", DisplayName = "Footer row CSS Style", Description = "CSS style attribute of the footer rows.", Enums = new string[] { "color:red;font-size:15pt;" }, UseOnlyEnumValues = false });
    Template.Parameters.Add(new Parameter() { Name = "print_break_after_page", DisplayName = "Print: Force a break after a page", BoolValue = false, Description = "If true, a new page is started after a page is displayed for the print layout." });
    Template.Parameters.Add(new Parameter() { Name = "invert_data_tables", DisplayName = "Options: Invert data table", BoolValue = false, Description = "If true, the columns and rows of the data table are swapped from their original presentation. This is valid only if the server pagination parameter is disabled in the root view." });
    Template.Parameters.Add(new Parameter() { Name = Parameter.ColumnsHiddenParameter, DisplayName = "Options: Columns to hide", Value = "", Description = "List of column numbers to hide in the table. List of indexes separated by semi-column (e.g. '1;2' to hide column 1 and 2).", Enums = new string[] { "2;4;6" }, UseOnlyEnumValues = false });

    //Allowed template parent names
    Template.ParentNames = new List<string>() { "Model", "Container", "Container Grid Flex", "Widget", "Tab Page" };
}
